﻿@model ChangePasswordModel
@{
    Layout = "_ColumnsTwo";

    //title
    NopHtml.AddTitleParts(T("PageTitle.Account").Text);
    //page class
    NopHtml.AppendPageCssClassParts("html-account-page");
    NopHtml.AppendPageCssClassParts("html-change-password-page");
    var returnUrl = Context.Request.Query["returnUrl"];
}
@section left
{
    @await Component.InvokeAsync(typeof(CustomerNavigationViewComponent), new { selectedTabId = CustomerNavigationEnum.ChangePassword })
}

<div class="page account-page change-password-page">
    <div class="page-title">
        <h1>@T("Account.MyAccount") - @T("Account.ChangePassword")</h1>
    </div>
    <div class="page-body">
        @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.CustomerChangePasswordTop, additionalData = Model })
        <form asp-route="@NopRouteNames.Standard.CUSTOMER_CHANGE_PASSWORD" method="post" autocomplete="off" asp-route-returnurl="@returnUrl">
            <div asp-validation-summary="ModelOnly" class="message-error"></div>
            <section class="fieldset">
                <div class="form-fields">
                    <div class="warnings">
                        @if (Model.PasswordExpired)
                        {
                            <p>@T("Account.ChangePassword.PasswordIsExpired")</p>
                        }
                        @if (Model.PasswordMustBeChanged)
                        {
                            <p>@T("Account.ChangePassword.MustBeChanged")</p>
                        }
                    </div>
                    <div class="inputs">
                        <label asp-for="OldPassword" asp-postfix=":"></label>
                        <div class="form-input-wrapper">
                            <input asp-for="OldPassword" />
                            <div class="change-password-recovery-link">
                                <a asp-route="@NopRouteNames.Standard.PASSWORD_RECOVERY">@T("Account.Login.ForgotPassword")</a>
                            </div>
                        </div>
                        <nop-required />
                        <span asp-validation-for="OldPassword"></span>
                    </div>
                    <div class="inputs">
                        <label asp-for="NewPassword" asp-postfix=":"></label>
                        <input asp-for="NewPassword" />
                        <nop-required />
                        <span asp-validation-for="NewPassword"></span>
                    </div>
                    <div class="inputs">
                        <label asp-for="ConfirmNewPassword" asp-postfix=":"></label>
                        <input asp-for="ConfirmNewPassword" />
                        <nop-required />
                        <span asp-validation-for="ConfirmNewPassword"></span>
                    </div>
                </div>
            </section>
            <section class="buttons">
                <button type="submit" class="button-1 change-password-button">@T("Account.ChangePassword.Button")</button>
            </section>
        </form>
        @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.CustomerChangePasswordBottom, additionalData = Model })
    </div>
</div>